package com.tucc.hello.leetcode.no1_400.no1_200.no1_20.no1_10.no9;

/**
 * @author tucc
 * @description todo
 * @package com.tucc.hello.leetcode
 * @date 2021/5/20
 **/
public class Solution {

    public static void main(String[] args) {
        Solution solution = new Solution();

    }

    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        long n = 0;
        int t = x;
        int p = 10;
        while ( t > 0) {
            n = n * p + t % 10;
            t /= 10;
            if(n > Integer.MAX_VALUE){
                return false;
            }
        }
        return n == x;
    }

}
